<script type="text/javascript" src="/scripts/utilities.js"></script>
<script type="text/javascript" src="/scripts/common.js"></script>
<link type="text/css" href="/styles/style.css" rel="stylesheet" />
<script src="/scripts/jquery.fcbkcomplete.js" type="text/javascript" charset="utf-8"></script>


<script type="text/javascript">
	$(document).ready(function(){                
                $("#select3").fcbkcomplete({
                    json_url: "/album/photos/get-contact-mails",
                    addontab: true,                   
                    maxitems: 10,
                    input_min_size: 0,
                    height: 10,
                    cache: true,
                    newel: true,
                    select_all_text: "select",
                });
            });	
</script>

		<form enctype="multipart/form-data" id="messageform" name="messageform" method="POST" action="/album/photos/add-share-photos/<?php echo $ctx->photos.'/'.$ctx->photo_diffid.'/'.$ctx->type; ?> ">
		<div class="PhoVidCrtForm">
		<div class="pad_t8">
		<div class="pad_t8">
		<label>&nbsp;</label>
		<div class="Fleft">
		<input type="radio" name="radio" value ="group" style="width:30px;" onchange="showGroups(this)"/>Group
		</div>
		<div class="Fleft">
		<input type="radio" name="radio" value ="public" style="width:30px;" checked="checked" onchange="showGroups(this)"/>Public
		</div>
		<div class="clear"></div>
		</div>
		<div class="pad_t8" id="div2">
		</div>
		<div class="clear"></div>
		<div class="pad_t8">
		<label>&nbsp;</label>
		<a class="Button" href="javascript:void(0);" onclick="create(document.messageform);"><span>Share</span></a>
		<div class="clear"></div>
		</div>
		</div>
	</div>
	</form>
<script>
//<![CDATA[

function create(frm)
{
	
	$('#messageform').submit();
	
	//alert(result);
	//return result;
}
function showGroups(obj)
{
	//alert(obj.value);return false;
	if(obj.value == "group")
	document.getElementById('div2').innerHTML = '<div><label>Select Group</div></label><select id="group" name="group[]" class="medium" size=4 multiple><option value="0" >--- Options ---</option><?php $i=0;while($i<($ctx->count)){ ?><option value="<?php echo $ctx->groups[$i]['group_id']; ?>"><?php echo $ctx->groups[$i]['name']; ?></option><?php $i++; }?></select>';
	
	else  document.getElementById('div2').innerHTML='';

}
//]]>
</script>
